package com.flyqiu.flow.api.candidate;

import com.flyqiu.common.user.FlyQiuUser;

import java.util.Collection;

/**
 * 候选人管理器
 */
public interface FlyQiyFlowCandidateManage<C extends FlowCandidateContext, CI extends FlowInstCandidateContext> {
    C createCandidateContext(FlowCandidateContext context);

    CI createCandidateContext(FlowInstCandidateContext context);

    /**
     * 注册候选人加载器
     *
     * @param loadCandidate 加载器
     */
    public void register(FlowCandidateLoad<?, C, CI> loadCandidate);

    /**
     * 加载候选人
     *
     * @param candidateContext@return
     */
    Collection<? extends FlyQiuUser> loadElementCandidates(C candidateContext);

    /**
     * 加载候选人
     *
     * @param candidateContext@return
     */
    Collection<? extends FlyQiuUser> loadInstCandidates(CI candidateContext);


}
